import request from "@/api/request.js";
import { Avatar } from "element-ui";

export function login(params) {
  return request({
    url: "/api/user/login",
    method: 'post',
    data: params,
  })
}

export function loginByEmail(params) {
  return request({
    url: "/api/user/mailLogin",
    method: 'post',
    data: params,
  })
}

export function register(params) {
  return request({
    url: "/api/user/reg",
    method: 'post',
    data: params,
  })
}

export function getAuthCode(params) {
  return request({
    url: "/api/user/getAuthCode",
    method: 'post',
    data: params,
  })
}

//修改个人信息
export function modify(params){
  console.log("修改的参数", params);
  return request({
    url: "/api/user/modify" ,
    method: 'post',
    data: params,
  })
}



//获取用户信息
export function getAuthorInfo(params){
  return request({
    url: "api/user/getAuthorInfo/" + params,
    method: "get",
    data: params
  })
}